<template>
  <div class="app">
    <div class="Header flex">
      <div class="flex ai-center jc-between w-200 p-10">
        <span class="bold fs-56">BCms</span>
        <i @click="CollapseClick" class="pointer" :class="Collapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'"></i>
      </div>
      <Header></Header>
    </div>

    <el-container class="Main bg-F8">
      <el-aside :style="asideWidth"><AsideMenu :Collapse="Collapse"></AsideMenu></el-aside>

      <el-main> <router-view></router-view></el-main>
    </el-container>
  </div>
</template>

<script>
import AsideMenu from "@/components/Aside";
import Header from "@/components/Header";

export default {
  components: {
    AsideMenu,
    Header,
  },
  data() {
    return {
      Collapse: false,
      asideWidth: { width: "200px" },
    };
  },
  methods: {
    CollapseClick() {
      this.Collapse = !this.Collapse;
      this.asideWidth.width = this.Collapse ? "64px" : "200px";
    },
  },
};
</script>

<style lang="less">
@HeaderHeight: 60px;
.app {
  .el-aside {
    transition: width 0.3s;
    height: calc(100vh - @HeaderHeight);
    overflow: hidden;
  }
  .Header {
    height: @HeaderHeight;
  }
  .Main {
    height: calc(100vh - @HeaderHeight);
  }
}
</style>
